export default function() {
	// #ifdef APP-PLUS
	return new Promise((resolve, reject) => {
		plus.runtime.getProperty(plus.runtime.appid, function(widgetInfo) {
			const data = {
				action: 'checkVersion',
				appid: plus.runtime.appid,
				appVersion: plus.runtime.version,
				wgtVersion: widgetInfo.version
			}
			console.log("data: ", data);
			uniCloud.callFunction({
				name: 'uni-upgrade-center',
				data,
				success: (e) => {
					console.log("e: ", e);
					resolve(e)
				},
				fail: (error) => {
					reject(error)
				}
			})
		})
	})
	// #endif
	// #ifndef APP-PLUS
	return new Promise((resolve, reject) => {
		console.log("APP-PLUS");
		// reject({
		// 	message: '请在App中使用'
		// })
		
		// 预览样式
		let data = {
			"result": {
				code: 200,
				message: "成功",
				is_silently: false, // 是否静默更新
				url: "http://clips.vorwaerts-gmbh.de/big_buck_bunny.apk", // 安装包下载地址
				platform: "and", // 安装包平台
				type: "apk" // 安装包类型
			}
		}
		resolve(data)
	})
	// #endif
}